﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Step3_2_2 : CtrlStep
{
    public InputField inputField;
    public Button sendBtn;
    public string inputkey;
    public GameObject txtGo;
    public Transform parent;
    public string result;

    public override void Init()
    {
        sendBtn.onClick.RemoveAllListeners();
        sendBtn.onClick.AddListener(CheckInput);

    }

    public void CheckInput()
    {
        if (inputField.text.Contains(inputkey))
        {
            isOver = true;
            GameObject go = GameObject.Instantiate<GameObject>(txtGo);
            go.transform.SetParent(parent);
            go.GetComponent<Text>().text = result;
            inputField.text = "";
        }
    }

}
